package web.suzy.oj.dao.judge.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import web.suzy.oj.dao.judge.JudgeEntityService;
import web.suzy.oj.mapper.JudgeMapper;
import web.suzy.oj.pojo.entity.judge.Judge;
import web.suzy.oj.pojo.vo.ProblemCountVO;

import java.util.List;

/**
 * YangSuzy 软件工作室
 * 类名: JudgeEntityServiceImpl
 * 描述: ---- 待定 -----
 * 功能: ---- 待定 -----
 * ==========未完成==============
 *
 * @author YangSuzy
 * Date: 2022/11/20 15:56
 */
@Service
@Slf4j(topic = "suzyoj")
public class JudgeEntityServiceImpl extends ServiceImpl<JudgeMapper, Judge> implements JudgeEntityService {
    @Autowired
    private JudgeMapper judgeMapper;

    /**
     * 方法名: getProblemCount
     * 描述: 获取单个题目评测统计
     *
     * @param pid 题目ID
     * @return web.suzy.oj.pojo.vo.ProblemCountVO
     * @date 2022/11/20 16:00
     * @auther YangSuzy
     **/
    @Override
    public ProblemCountVO getProblemCount(Long pid) {
        return judgeMapper.getProblemCount(pid);
    }

    /**
     * 方法名: getProblemListCount
     * 描述: 根据题目列表获取题目评测统计
     *
     * @param pidList 题目ID列表
     * @return java.util.List<web.suzy.oj.pojo.vo.ProblemCountVO>
     * @date 2022/11/20 16:03
     * @auther YangSuzy
     **/
    @Override
    public List<ProblemCountVO> getProblemListCount(List<Long> pidList) {
        return judgeMapper.getProblemListCount(pidList);
    }

    /**
     * 方法名: getTodayJudgeNum
     * 描述: 获取今日提交测评数量
     *
     * @return int
     * @date 2022/11/23 14:19
     * @auther YangSuzy
     **/
    @Override
    public int getTodayJudgeNum() {
        return judgeMapper.getTodayJudgeNum();
    }
}
